import {
  status,
  openStatus,
  functionTypeOptions,
  variableTypes
} from '@libs/data/enums'

const enumsMap = {
  variableTypes,
  status,
  smsSend: openStatus,
  repeat: openStatus,
  functionType: functionTypeOptions
} as any

export default function filter(enumKey: string, value: unknown) {
  const enumList = enumsMap[enumKey]
  if (!enumList) return ''
  const target = enumList.find((e: { value: unknown }) => e.value === value)
  return target && target.label
}
